package com.example.demo.project.controller;

import com.example.demo.project.domain.User;
import com.example.demo.project.domain.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Administrator on 2018-2-8.
 */
@Controller
public class StudentPageController {

    @Autowired
    private UserRepository userRepository;

    @RequestMapping("/index")
    public String index(Model model, HttpServletRequest request) {
        User user=new User();
        user.setUserName("省文星");
        user.setEmail("123@163.com");
        request.getSession().setAttribute("user",user);
        return "/student/index";
    }


}
